package com.kedacom.emptyproject.map.adapter

import android.databinding.BindingAdapter
import android.view.View
import com.kedacom.emptyproject.map.widget.MapLayerBottomTabView
import com.kedacom.emptyproject.util.dp2px

/**
 * @author GuanHaoran
 * @description:
 * @date :2020/10/29 10:35 AM
 */
@BindingAdapter("botStateVisibility")
fun botStateVisibility(view: View, state: String) {
    val c = state.contains("0").not()
    view.visibility = if (c) View.VISIBLE else View.GONE
}

@BindingAdapter("botStatePaddingBottom")
fun paddingBottom(view: View, paddingBottom: String) {
    val r = paddingBottom.contains("0")
    view.setPadding(0, 0, 0, if (r) 0 else 50.dp2px())
}

@BindingAdapter("tab_view_state")
fun tabViewState(view: MapLayerBottomTabView, state: String) {
    view.setTabViewState(state)
}

